import {HTTP} from '../util/http.js'
import { HTTPP} from '../util/http-p.js'

class ShiftModel extends HTTPP{

    getTodayClass(uid, day){
        return this.request({
                url:'shift/today',
                data:{
                    wuid: uid,
                    date: day
                },
        })
    }

    getWeekClass(workerID){
        return  this.request({
                  url:'shift/list',
                  data:{
                    workerID:workerID
            },
            
        })
    }

    getPreviousWeek(workerID){
        return this.request({
                url:'shift/previous',
                data:{
                  workerID: workerID
            },
            
        })
    }

    addOneShift(wuid,shiftValue,date){
        return this.request({
            url:'shift/mini/one',
            data:{
            wuid: wuid,
            shiftValue: shiftValue,
            date: date
            },
        method: 'POST',
        })
    }

    updateOneShift(wuid,shiftValue,date){
        return this.request({
            url:'shift/mini/one/update',
            data:{
            wuid: wuid,
            shiftValue: shiftValue,
            date: date
        },
        method: 'PUT',
        })
    }
}

export {
    ShiftModel
}